-- Copyright (C) 2016 Koz Ross <koz.ross@retro-freedom.nz>

-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.

-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.

-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

import BasicPrelude hiding (empty)

import Data.Logic.DNF

import Weigh

import Test.QuickCheck

main :: IO ()
main = do
  f <- generate (resize 10 arbitrary :: Gen Form)
  i <- generate (resize 10 arbitrary :: Gen Interpretation)
  mainWith (do
               func "slow" (interpretSafe i) f
               func "fast" (interpret i) f)
  -- do
  -- let sizes = [10, 20 .. 50]
  -- let names = fmap (textToString . ("b" ++) . show) sizes
  -- testData <- generate $ traverse (\x -> resize x arbitrary :: Gen Form) sizes
  -- testForms <- generate $ traverse (\x -> resize x arbitrary :: Gen Interpretation) sizes
  -- let interpreted = zip3 names testForms testData
  -- mainWith (traverse (\(s, i, f) -> func ("slow " ++ s) (interpretSafe i) f) interpreted)
  -- mainWith (traverse (\(s, i, f) -> func ("fast " ++ s) (interpret i) f) interpreted)
